#ifndef _MY_GUN_H_
#define _MY_GUN_H_

#include "cocos2d.h"
#include "../bullet.h"

using namespace cocos2d;

namespace fireplane{
	class Gun : public CCNode{
	public:
		enum GunType{
			GT_normal_gun = 0,
			CT_circle_gun,
		};

		struct CreateArg{
			CreateArg(GunType t):
				_type(t)
			{}
			GunType _type;
		};

		struct CreateNormalGun : CreateArg{
			CreateNormalGun(GunType t):
				CreateArg(t){}

			CCPoint tdir;
			float tspeed;
			Bullet::BulletOwner o;
			CCPoint pos;
		};

		static Gun* createGun(CreateArg* arg);

		Gun();
		~Gun();
		virtual void fire(Bullet::BulletImg img) = 0;
		virtual void InitGun(CreateArg* arg) = 0;

		void setBulletType(Bullet::BulletType type){
			_bulletType = type;
		}

	protected:
		Bullet::BulletType _bulletType;
	};

}

#endif